class Solution
{
public:
    bool canPermutePalindrome(string s)
    {
        unordered_map<char, int> charCount;
        for (char c : s)
        {
            ++charCount[c];
        }
        bool oddExist = false;
        for (auto &[c, count] : charCount)
        {
            if (count & 1)
            {
                if (!oddExist)
                {
                    oddExist = true;
                }
                else
                {
                    return false;
                }
            }
        }
        return true;
    }
};